{% extends 'base.html' %}
{#http://127.0.0.1:5000/test/template/optionsTest.html#}
{% block container %}

{#    报告容器#}
    <div id="report"></div>

{% endblock %}

{% block script %}
{#    报告工具#}
    <script type="text/javascript" src="{{ url_for('static',filename='js/echarts.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static',filename='js/Sortable.min.js') }}"></script>
    <script type="text/javascript"  src="{{ url_for('static',filename='main/Report.js') }}"></script>
    <script type="text/javascript">

    var report = new Report('report');
{#    模板数据预览 #}
        $.get('../../main/options/zs',function (data) {
           console.log(data);
           if(data.code===0)
           {
               var report_data = data.data;

                report_data.forEach(function (ele,index) {
                    console.log('添加'+ele['title']);
                   report.addElement(ele['element']);
                });

           }
           else {
               console.log('加载失败...');
           }
        });


    </script>
{% endblock %}